using System;
using System.ComponentModel.DataAnnotations;
using HengTong.Model.Interfaces;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Attributes;

namespace HengTong.Model.Db.Article;

/// <summary>
/// 文章附件表
/// 用于支持文章的多文件附件
/// </summary>
[MiddleTable]
public class SysArticleAttachment : BasePoco, IFileBase
{
    [Required]
    [Display(Name = "文章ID", Description = "关联的文章ID", GroupName = "关联信息")]
    public Guid? ArticleId { get; set; }

    [Display(Name = "文章", Description = "关联的文章对象", GroupName = "关联信息")]
    public SysArticle Article { get; set; }

    // ISubFile 接口定义的字段
    [Display(Name = "文件ID", Description = "文件唯一标识", GroupName = "文件信息")]
    public Guid? FileId { get; set; }

    [Display(Name = "文件", Description = "文件对象", GroupName = "文件信息")]
    public FileAttachment File { get; set; }

    [Display(Name = "排序", Description = "附件显示顺序", GroupName = "文件信息")]
    public int Order { get; set; }

    [Display(Name = "附件类型", Description = "附件类型，如：封面图、内容图、下载文件等", GroupName = "文件信息")]
    [StringLength(64)]
    public string AttachmentType { get; set; }

    [Display(Name = "附件描述", Description = "附件的描述信息", GroupName = "文件信息")]
    [StringLength(256)]
    public string Description { get; set; }

    [Display(Name = "是否显示", Description = "是否在前端显示", GroupName = "显示设置")]
    public bool IsVisible { get; set; } = true;
}
